-
Notifications
You must be signed in to change notification settings - Fork 345
Create .exdoc file after warning about using an existing directory #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create .exdoc file after warning about using an existing directory #1713
Conversation
Is this something we could add a test on? Do we test the warning is emitted? If so, can we test the warning is not emitted on the second run? thank you ❤️ |
I've added this check to the tests that I've added when implementing this feature, I think there's no reason to duplicate the entire test just to test this property. |
Not sure why this test failing, I've just ran the test suite locally 15 times in a row and it passed them all consistently 🤔 |
You are capturing output from other tests that are running concurrently. You may need to mark those cases as async: false (or move those particular tests to another module with async: false). |
@wojtekmach is there a better test structure we could use here? |
|
||
assert ExUnit.CaptureIO.capture_io(:stderr, fn -> | ||
generate_docs(tmp_dir) | ||
end) =~ "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any string would pass this assertion be we want to make sure we didn't print any warnings!
end) =~ "" | |
end) == "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad here, forgot to change the operator
Thank you! |
Currently, if an user tries to set
--output
to a directory that already contains files, ex_doc will emit a warning about that and create the files anyway, but it never creates the.exdoc
file, meaning every timemix docs
is run on that directory it will display the same warnings.This pull requests calls the create callback after emitting the warning, so that in subsequent invocations no warnings will be emitted.